package com.friends.digitpic.business.service.impl;

import com.friends.digitpic.business.service.PicBusinessService;
import com.friends.digitpic.service.dao.PicDao;
import com.friends.digitpic.service.entity.PicEntity;
import com.friends.digitpic.service.service.PicService;
import org.jeecgframework.minidao.pojo.MiniDaoPage;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * Created by fusio on 2018/9/15.
 */
@Transactional
@Component
public class PicBusinessServiceImpl implements PicBusinessService {

    @Resource(name = "picDao")
    private PicDao picDao;
    @Resource
    private PicService picService;

    @Override
    public MiniDaoPage<PicEntity> getPicturesByGroup(String groupid,int page,int row) {
        PicEntity entity = new PicEntity();
        entity.setGroupid(groupid);
        MiniDaoPage<PicEntity> result = picService.getPicAll(entity,page,row);

        return result;
    }

    @Override
    public MiniDaoPage<PicEntity> getPictruesByKind(String kindName,int page,int row){
        PicEntity entity = new PicEntity();
        entity.setPictype(kindName);

        MiniDaoPage<PicEntity> result = picService.getPicAll(entity,page,row);

        return  result;
    }
}
